<?php

use App\Models\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;

class UsersTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {

        $user = new User;
        $user->name = '雷里雷';
        $user->password = Hash::make('111111');
        $user->role = User::ROLE_STUDENT;
        $user->save();
        $user = new User;
        $user->name = 'admin';
        $user->password = Hash::make('111111');
        $user->role = User::ROLE_ADMIN;
        $user->save();
        $user = new User;
        $user->name = 'teacher';
        $user->password = Hash::make('111111');
        $user->role = User::ROLE_TEACHER;
        $user->save();
        factory(User::class, 10)->create(['role' => User::ROLE_STUDENT]);
        factory(User::class, 10)->create(['role' => User::ROLE_TEACHER]);
        factory(User::class, 2)->create(['role' => User::ROLE_ADMIN]);
    }
}
